/*
 *
 * Saturn Framework Co.Limt
 * Copyright (c) 2012-2019 tanks, Inc. All rights reserved.
 */
 
package com.saturn.config.server.base.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.saturn.config.server.base.dto.ConfigInfo;
import com.saturn.config.server.base.entity.AppConfig;

/**
 * <dl>
 *    <dt><b>Title:</b></dt>
 *    <dd>
 *    	none
 *    </dd>
 *    <dt><b>Description:</b></dt>
 *    <dd>
 *    	<p>应用配置项
 *    </dd>
 *
 * @author tanks
 * @date 2019-07-08 15:58:43
 */
public interface AppConfigMapper extends BaseMapper<AppConfig> {

	/**
	 * 查询分页
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public IPage<ConfigInfo> queryPage(IPage<ConfigInfo> page,@Param("map") Map<String,Object> params);
	
	/**
	 * 查询应用配置信息
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public List<ConfigInfo> queryAppConfigs(@Param("map") Map<String,Object> params);
	
	/**
	 * 查询应用公共配置信息
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public List<ConfigInfo> queryAppPublicConfigs(@Param("map") Map<String,Object> params);
	
	/**
	 * 从项目复制配置到指定内容
	 * @param fromAppId
	 * @param toAppId
	 * @return
	 */
	public Integer copyFromProject(@Param("fromAppId") Long fromAppId,@Param("toAppId") Long toAppId);
	
	/**
	 * 应用升级至版本
	 * @param fromAppId
	 * @param toAppId
	 * @return
	 */
	public Integer upgradeVersion(@Param("appId") Long fromAppId,@Param("fromVersion") String fromVersion,@Param("upgradeVersion") String upgradeVersion);
	
}
